<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>window对象--全局作用域</title>
	</head>
	<body>
		<script>
			var area='wenzhou';
			console.log(area);
			console.log(window,area);
			
			function getArea(){
				return this;
			}
			console.log(getArea());//直接调用函数:指的是window对象(this)
			console.log(window.getArea());
		//如果把方法加到某个对象内，方法就指向该对象(this)	
		var obj={
				name:'Tom',
				c:getArea
		};
			console.log(obj.c());
		</script>
	</body>
</html>
